import { useUserStore } from '@fl/store/modules/user'

const currentRole = computed(() => {
    const userStore = useUserStore()

    const userInfo = userStore.getUserInfo
    return userInfo?.sysUser?.roles?.[0]?.roleKey || 'visitor'
})
// 管理员
const isAdmin = computed(() => {
    return currentRole.value === 'operationer'
})
// 供应商
const isSupplier = computed(() => {
    return currentRole.value === 'supplier'
})
// 采购商
const isPurchaser = computed(() => {
    return currentRole.value === 'purchaser'
})
export {
    isAdmin,
    isSupplier,
    isPurchaser,
}
